package java111;

import java.util.Scanner;

public class Day11 {
    // https://ac.nowcoder.com/acm/problem/255193
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        long n = in.nextLong();
        long m = in.nextLong();
        long a = in.nextLong();
        long b = in.nextLong();
        long res = 0;
        long min = Math.min(n/2, m);
        for(long i = 0; i <= min; i++){
            long j = Math.min(n-2*i, (m-i)/2);
            res = Math.max(res, i*a + j*b);
        }
        System.out.println(res);
    }

    //https://www.nowcoder.com/practice/fbc5dad3e215457fb82a3ae688eb7281
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int n = in.nextInt();
            int[] arr = new int[n];
            for(int i = 0; i < n; i++){
                arr[i] = in.nextInt();
            }
            int res = 0;
            for(int i = 0; i < n-1; ){
                int j = i;
                while(j < n-1 && arr[j] < arr[j+1]){
                    j++;
                }
                res += arr[j] - arr[i];
                i = j+1;
            }
            System.out.println(res);
        }
    }


    //https://www.nowcoder.com/practice/ee5de2e7c45a46a090c1ced2fdc62355?tpld=182&tqld=34788&ru=/exam/oj
    public static void main2(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNext()) { // 注意 while 处理多个 case
            String s = in.nextLine();
            String[] arr = s.split(" ");
            StringBuilder sb = new StringBuilder();
            for(int i = arr.length-1; i>= 0; i--){
                sb.append(arr[i] + " ");
            }
            sb.deleteCharAt(sb.length()-1);
            System.out.println(sb);
        }
    }
}
